package towerDefense;

/**
 * Bullets are the basest type of ammunition for the basic bullet tower. 
 * 
 * @author Guillermo Mendez-Kestler
 *
 */
public class Projectile_Bullet  extends T_Projectile implements I_Projectile {
	/**
	 * SPEED of the bullet
	 */
	public static final double SPEED = 150;

	/**
	 * Number of milliseconds between each bullet fired.
	 */
	public static final int RATE_OF_FIRE = 500;

	/**
	 * Amount of DAMAGE done by each bullet at tower LEVEL.
	 */
	public static final int BULLET_LEVEL_1 = 5;
	public static final int BULLET_LEVEL_2 = 10;
	public static final int BULLET_LEVEL_3 = 15;
	public static final int BULLET_LEVEL_4 = 20;
	public static final int BULLET_LEVEL_5 = 25;

	/**
	 * Size of the bullet in the world. 
	 */
	private static final double BULLET_SIZE = 0.5;

	/**
	 * Tower that fires the bullet. 
	 */
	private static Tower_Bullet BULLET_TOWER;

	/**
	 * HEADING the BULLET is traveling. 
	 */
	private static double BULLET_HEADING;

	/**
	 * Creates a bullet with the specified power level from 
	 * the level of the tower. 
	 * 
	 * @param tower Bullet tower that fired the bullet. 
	 * @param heading Direction (angle in radians) the bullet
	 * is currently heading. 
	 */
	public Projectile_Bullet(Tower_Bullet tower, double heading){
		super(tower.getSpace().getCenterX(), tower.getSpace().getCenterY(), BULLET_SIZE, Constants.PROJECTILE_BULLET);
		BULLET_TOWER = tower;
		BULLET_HEADING = heading;
	}

	/**
	 * Returns the bullet's heading, in degrees. 0 degrees is "north" and the angle
	 * increases clockwise.
	 *
	 * @return the bullet's heading
	 */
	public double getHeading() {
		return BULLET_HEADING;
	}

	/**
	 * Returns the TOWER that fired the bullet.
	 *
	 * @return The firing tower.
	 */
	public Tower_Bullet getTower() {
		return BULLET_TOWER;
	}
}

